package com.shy.entity;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
@PropertySource(value = {"classpath:application.yml"})
public class Car {
    @Value("${shy.car.brand}")
    private String brand;
    @Value("${shy.car.color}")
    private String color;
    @Value("${shy.car.price}")
    private float price;
    @Value("${shy.car.type:10101}")
    private int type;
    @Value("#{{'语文':'99','数学':'100'}}")
    private Map<String, Integer> score;
    @Value("#{'睡觉,吃饭,喝水,拉屎'}")
    private List<String> hobbies;

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        this.price = price;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }
    public Map<String, Integer> getScore() {
        return score;
    }
    public void setScore(Map<String, Integer> score) {
        this.score = score;
    }

    public List<String> getHobbies() {
        return hobbies;
    }

    public void setHobbies(List<String> hobbies) {
        this.hobbies = hobbies;
    }

    @Override
    public String toString() {
        return "Car{" +
                "brand='" + brand + '\'' +
                ", color='" + color + '\'' +
                ", price=" + price +
                ", type=" + type +
                ", score=" + score +
                ", hobbies=" + hobbies +
                '}';
    }
}
